package cn.edu.wfit.modules.learn.service.impl.competitionmanagement;

import java.util.List;
import cn.edu.wfit.common.core.utils.DateUtils;
import cn.edu.wfit.modules.learn.domain.WfitCompetitionConfig;
import cn.edu.wfit.modules.learn.mapper.competitionmanagement.WfitCompetitionConfigMapper;
import cn.edu.wfit.modules.learn.service.competitionmanagement.IWfitCompetitionConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 竞赛分值Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-28
 */
@Service
public class WfitCompetitionConfigServiceImpl implements IWfitCompetitionConfigService
{
    @Autowired
    private WfitCompetitionConfigMapper wfitCompetitionConfigMapper;

    /**
     * 查询竞赛分值
     * 
     * @param id 竞赛分值主键
     * @return 竞赛分值
     */
    @Override
    public WfitCompetitionConfig selectWfitCompetitionConfigById(Long id)
    {
        return wfitCompetitionConfigMapper.selectWfitCompetitionConfigById(id);
    }

    /**
     * 查询竞赛分值列表
     * 
     * @param wfitCompetitionConfig 竞赛分值
     * @return 竞赛分值
     */
    @Override
    public List<WfitCompetitionConfig> selectWfitCompetitionConfigList(WfitCompetitionConfig wfitCompetitionConfig)
    {
        return wfitCompetitionConfigMapper.selectWfitCompetitionConfigList(wfitCompetitionConfig);
    }

    /**
     * 新增竞赛分值
     * 
     * @param wfitCompetitionConfig 竞赛分值
     * @return 结果
     */
    @Override
    public int insertWfitCompetitionConfig(WfitCompetitionConfig wfitCompetitionConfig)
    {
        wfitCompetitionConfig.setCreateTime(DateUtils.getNowDate());
        return wfitCompetitionConfigMapper.insertWfitCompetitionConfig(wfitCompetitionConfig);
    }

    /**
     * 修改竞赛分值
     * 
     * @param wfitCompetitionConfig 竞赛分值
     * @return 结果
     */
    @Override
    public int updateWfitCompetitionConfig(WfitCompetitionConfig wfitCompetitionConfig)
    {
        wfitCompetitionConfig.setUpdateTime(DateUtils.getNowDate());
        return wfitCompetitionConfigMapper.updateWfitCompetitionConfig(wfitCompetitionConfig);
    }

    /**
     * 批量删除竞赛分值
     * 
     * @param ids 需要删除的竞赛分值主键
     * @return 结果
     */
    @Override
    public int deleteWfitCompetitionConfigByIds(Long[] ids)
    {
        return wfitCompetitionConfigMapper.deleteWfitCompetitionConfigByIds(ids);
    }

    /**
     * 删除竞赛分值信息
     * 
     * @param id 竞赛分值主键
     * @return 结果
     */
    @Override
    public int deleteWfitCompetitionConfigById(Long id)
    {
        return wfitCompetitionConfigMapper.deleteWfitCompetitionConfigById(id);
    }
}
